package in.careerscale.apps.ocms.dao.model;

// Generated Jul 7, 2013 10:49:55 AM by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * HelpCategoryType generated by hbm2java
 */
@Entity
@Table(name = "help_category_type", catalog = "ocms", uniqueConstraints = @UniqueConstraint(columnNames = "category_name"))
public class HelpCategoryType implements java.io.Serializable {

	private Integer id;
	private HelpCategoryType helpCategoryType;
	private String categoryName;
	private String description;
	private Set<CaseMaster> caseMasters = new HashSet(0);
	private Set<LoginMaster> loginMasters = new HashSet(0);
	private Set<HelpCategoryType> helpCategoryTypes = new HashSet(0);

	public HelpCategoryType() {
	}

	public HelpCategoryType(String categoryName) {
		this.categoryName = categoryName;
	}

	public HelpCategoryType(HelpCategoryType helpCategoryType,
			String categoryName, String description, Set caseMasters,
			Set loginMasters, Set helpCategoryTypes) {
		this.helpCategoryType = helpCategoryType;
		this.categoryName = categoryName;
		this.description = description;
		this.caseMasters = caseMasters;
		this.loginMasters = loginMasters;
		this.helpCategoryTypes = helpCategoryTypes;
	}

	public HelpCategoryType(String name, String description)
	{
		this.categoryName = name;
		this.description = description;
	}

	public HelpCategoryType(Integer id, String name, String description)
	{

		this.id = id;
		this.categoryName = name;
		this.description = description;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parent_type_id")
	public HelpCategoryType getHelpCategoryType() {
		return this.helpCategoryType;
	}

	public void setHelpCategoryType(HelpCategoryType helpCategoryType) {
		this.helpCategoryType = helpCategoryType;
	}

	@Column(name = "category_name", unique = true, nullable = false, length = 50)
	public String getCategoryName() {
		return this.categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	@Column(name = "description", length = 100)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "helpCategoryType")
	public Set<CaseMaster> getCaseMasters()
	{
		return this.caseMasters;
	}

	public void setCaseMasters(Set<CaseMaster> caseMasters)
	{
		this.caseMasters = caseMasters;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "help_category_user", catalog = "ocms", joinColumns = { @JoinColumn(name = "help_category_id", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "user_id", nullable = false, updatable = false) })
	public Set<LoginMaster> getLoginMasters()
	{
		return this.loginMasters;
	}

	public void setLoginMasters(Set<LoginMaster> loginMasters)
	{
		this.loginMasters = loginMasters;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "helpCategoryType")
	public Set<HelpCategoryType> getHelpCategoryTypes()
	{
		return this.helpCategoryTypes;
	}

	public void setHelpCategoryTypes(Set<HelpCategoryType> helpCategoryTypes)
	{
		this.helpCategoryTypes = helpCategoryTypes;
	}

}
